﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 物资信息表基础输入参数
/// </summary>
public class StoreMaterialsBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    [Required(ErrorMessage = "分类不能为空")]
    public virtual long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>
    [Required(ErrorMessage = "物资名称不能为空")]
    public virtual string Name { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>
    [Required(ErrorMessage = "单位不能为空")]
    public virtual string? Unit { get; set; }
    
    /// <summary>
    /// 单价
    /// </summary>
    [Required(ErrorMessage = "单价不能为空")]
    public virtual decimal? Price { get; set; }
    
    /// <summary>
    /// 最小库存
    /// </summary>
    [Required(ErrorMessage = "最小库存不能为空")]
    public virtual int? MinStock { get; set; }
    
    /// <summary>
    /// 最大库存
    /// </summary>
    [Required(ErrorMessage = "最大库存不能为空")]
    public virtual int? MaxStock { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    public virtual int? OrderNo { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Dict(nameof(StatusEnum), AllowNullValue=true)]
    public virtual StatusEnum? Status { get; set; }
    
    /// <summary>
    /// 当前库存数量
    /// </summary>
    public virtual decimal? CurrentStock { get; set; }
    
    /// <summary>
    /// 可用库存
    /// </summary>
    public virtual decimal? AvailableStock { get; set; }
    
    /// <summary>
    /// 预留库存
    /// </summary>
    public virtual decimal? ReservedStock { get; set; }
    
    /// <summary>
    /// 入库库存
    /// </summary>
    public virtual decimal? InTransitStock { get; set; }
    
    /// <summary>
    /// 库存状态
    /// </summary>
    [Dict(nameof(StockStatusEnum), AllowNullValue=true)]
    public virtual StockStatusEnum? StockStatus { get; set; }
    
    /// <summary>
    /// 最后库存更新时间
    /// </summary>
    public virtual DateTime? LastStockUpdateTime { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
}

/// <summary>
/// 物资信息表分页查询输入参数
/// </summary>
public class PageStoreMaterialsInput : BasePageInput
{
    /// <summary>
    /// 物资分类
    /// </summary>
    public long StoreTypeId { get; set; }
    /// <summary>
    /// 物资名称
    /// </summary>
    public string Name { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Dict(nameof(StatusEnum), AllowNullValue=true)]
    public StatusEnum? Status { get; set; }
    
    /// <summary>
    /// 库存状态
    /// </summary>
    [Dict(nameof(StockStatusEnum), AllowNullValue=true)]
    public StockStatusEnum? StockStatus { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 物资信息表增加输入参数
/// </summary>
public class AddStoreMaterialsInput
{
    /// <summary>
    /// 分类
    /// </summary>
    [Required(ErrorMessage = "分类不能为空")]
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>
    [Required(ErrorMessage = "物资名称不能为空")]
    [MaxLength(128, ErrorMessage = "物资名称字符长度不能超过128")]
    public string Name { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>
    [Required(ErrorMessage = "单位不能为空")]
    [MaxLength(32, ErrorMessage = "单位字符长度不能超过32")]
    public string? Unit { get; set; }
    
    /// <summary>
    /// 单价
    /// </summary>
    [Required(ErrorMessage = "单价不能为空")]
    public decimal? Price { get; set; }
    
    /// <summary>
    /// 最小库存
    /// </summary>
    [Required(ErrorMessage = "最小库存不能为空")]
    public int? MinStock { get; set; }
    
    /// <summary>
    /// 最大库存
    /// </summary>
    [Required(ErrorMessage = "最大库存不能为空")]
    public int? MaxStock { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    public int? OrderNo { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Dict(nameof(StatusEnum), AllowNullValue=true)]
    public StatusEnum? Status { get; set; }
    
    /// <summary>
    /// 当前库存数量
    /// </summary>
    public decimal? CurrentStock { get; set; }
    
    /// <summary>
    /// 可用库存
    /// </summary>
    public decimal? AvailableStock { get; set; }
    
    /// <summary>
    /// 预留库存
    /// </summary>
    public decimal? ReservedStock { get; set; }
    
    /// <summary>
    /// 入库库存
    /// </summary>
    public decimal? InTransitStock { get; set; }
    
    /// <summary>
    /// 库存状态
    /// </summary>
    [Dict(nameof(StockStatusEnum), AllowNullValue=true)]
    public StockStatusEnum? StockStatus { get; set; }
    
    /// <summary>
    /// 最后库存更新时间
    /// </summary>
    public DateTime? LastStockUpdateTime { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(128, ErrorMessage = "备注字符长度不能超过128")]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 物资信息表删除输入参数
/// </summary>
public class DeleteStoreMaterialsInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 物资信息表更新输入参数
/// </summary>
public class UpdateStoreMaterialsInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>    
    [Required(ErrorMessage = "分类不能为空")]
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>    
    [Required(ErrorMessage = "物资名称不能为空")]
    [MaxLength(128, ErrorMessage = "物资名称字符长度不能超过128")]
    public string Name { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>    
    [Required(ErrorMessage = "单位不能为空")]
    [MaxLength(32, ErrorMessage = "单位字符长度不能超过32")]
    public string? Unit { get; set; }
    
    /// <summary>
    /// 单价
    /// </summary>    
    [Required(ErrorMessage = "单价不能为空")]
    public decimal? Price { get; set; }
    
    /// <summary>
    /// 最小库存
    /// </summary>    
    [Required(ErrorMessage = "最小库存不能为空")]
    public int? MinStock { get; set; }
    
    /// <summary>
    /// 最大库存
    /// </summary>    
    [Required(ErrorMessage = "最大库存不能为空")]
    public int? MaxStock { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>    
    public int? OrderNo { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>    
    [Dict(nameof(StatusEnum), AllowNullValue=true)]
    public StatusEnum? Status { get; set; }
    
    /// <summary>
    /// 当前库存数量
    /// </summary>    
    public decimal? CurrentStock { get; set; }
    
    /// <summary>
    /// 可用库存
    /// </summary>    
    public decimal? AvailableStock { get; set; }
    
    /// <summary>
    /// 预留库存
    /// </summary>    
    public decimal? ReservedStock { get; set; }
    
    /// <summary>
    /// 入库库存
    /// </summary>    
    public decimal? InTransitStock { get; set; }
    
    /// <summary>
    /// 库存状态
    /// </summary>    
    [Dict(nameof(StockStatusEnum), AllowNullValue=true)]
    public StockStatusEnum? StockStatus { get; set; }
    
    /// <summary>
    /// 最后库存更新时间
    /// </summary>    
    public DateTime? LastStockUpdateTime { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(128, ErrorMessage = "备注字符长度不能超过128")]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 物资信息表主键查询输入参数
/// </summary>
public class QueryByIdStoreMaterialsInput : DeleteStoreMaterialsInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataStoreMaterialsInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 设置状态输入参数
/// </summary>
public class SetStoreMaterialsStatusInput : BaseStatusInput
{
}

/// <summary>
/// 物资信息表数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportStoreMaterialsInput : BaseImportInput
{
    /// <summary>
    /// 分类 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 分类 文本
    /// </summary>
    [ImporterHeader(Name = "*分类")]
    [ExporterHeader("*分类", Format = "", Width = 25, IsBold = true)]
    public string StoreTypeDisplayName { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>
    [ImporterHeader(Name = "*物资名称")]
    [ExporterHeader("*物资名称", Format = "", Width = 25, IsBold = true)]
    public string Name { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>
    [ImporterHeader(Name = "*单位")]
    [ExporterHeader("*单位", Format = "", Width = 25, IsBold = true)]
    public string? Unit { get; set; }
    
    /// <summary>
    /// 单价
    /// </summary>
    [ImporterHeader(Name = "*单价")]
    [ExporterHeader("*单价", Format = "", Width = 25, IsBold = true)]
    public decimal? Price { get; set; }
    
    /// <summary>
    /// 最小库存
    /// </summary>
    [ImporterHeader(Name = "*最小库存")]
    [ExporterHeader("*最小库存", Format = "", Width = 25, IsBold = true)]
    public int? MinStock { get; set; }
    
    /// <summary>
    /// 最大库存
    /// </summary>
    [ImporterHeader(Name = "*最大库存")]
    [ExporterHeader("*最大库存", Format = "", Width = 25, IsBold = true)]
    public int? MaxStock { get; set; }

    /// <summary>
    /// 库存数量
    /// </summary>
    [ImporterHeader(Name = "库存数量")]
    [ExporterHeader("库存数量", Format = "", Width = 25, IsBold = true)]
    public decimal? CurrentStock { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
}
